#ifndef _MEMORY_H
#define _MEMORY_H

#include "types.h"

/* Our VM has a very large memory size: 256 bytes */
/* Yes, bytes! */
#define MEM_SIZE 256

/* Memory layout */
/* 0x00 ~ 0xEF, 240 bytes: program segment */
/* 0xF0 ~ 0xFD, 14  bytes: reserved */
/* 0xFE ~ 0xFF, 2   bytes: output buffer */

static BYTE g_mem[MEM_SIZE] = {};

int mem_set(BYTE, BYTE);
int mem_get(BYTE, BYTE*);
void mem_cpy(const BYTE* const, BYTE);

#endif
